#include<iostream>
#include<vector>
#include<cstring>
#include<ctime>
#define N 100009
using namespace std;
int p[10000];
bool flag[N];
int k=0;
void fun(){
	memset(flag,false,sizeof(flag));
	for(int i=2;k<10000;i++){
		if(flag[i]==false){
		p[++k]=i;
		for(int j=i;j<N;j+=i)
			flag[j]=true;
		}
	} 
}
int main(){
	clock_t start,end;
	start=clock();
	fun();
	end=clock();
	cout<<"CLOCKS_PER_SEC="<<CLOCKS_PER_SEC<<endl;
	cout<<(double)(end-start)<<endl;
	int index;
	while(cin>>index)
		cout<<p[index]<<endl;
}